import { createBrowserRouter, RouteObject } from "react-router-dom";
import Home from "../pages/Home/Home";
import TextTools from "../pages/TextTools";
import ImageTools from "../pages/ImageTools";
import MainLayout from "../components/Layout/MainLayout";
import ImageAndBase64 from "../pages/ImageTools/ImageAndBase64";
import SvgCodeToSvgFile from "../pages/ImageTools/SvgCodeToSvgFile";
import ImageCropping from "../pages/ImageTools/ImageCropping";
import ImgWatermark from "../pages/ImageTools/ImgWatermark";
import TextComparison from "../pages/TextTools/TextComparison";
import JsonFormat from "../pages/TextTools/JsonFormat";
import TextDeduplication from "@/pages/TextTools/TextDeduplication";
import TextTrim from "@/pages/TextTools/TextTrim";
import OtherTools from "@/pages/OtherTools";
import ImageWidthHeightModify from "@/pages/ImageTools/ImageWidthHeightModify";
import ImageToIco from "@/pages/ImageTools/imageToIco";
import ImageSplicing from "@/pages/ImageTools/ImageSplicing";
import NotFound from "@/pages/NotFound";
import Px2Rem from "@/pages/TextTools/Px2Rem";

const routes: RouteObject[] = [
  {
    path: "/",
    element: <MainLayout />,
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: "text-tools",
        element: <TextTools />,
      },
      {
        path: "image-tools",
        element: <ImageTools />,
      },
      {
        path: "image-tools/image-and-base64",
        element: <ImageAndBase64 />,
      },
      {
        path: "image-tools/svg-code-to-svg-file",
        element: <SvgCodeToSvgFile />,
      },
      {
        path: "image-tools/image-cropping",
        element: <ImageCropping />,
      },
      {
        path: "image-tools/img-watermark",
        element: <ImgWatermark />,
      },
      {
        path: "text-tools/text-comparison",
        element: <TextComparison />,
      },
      {
        path: "text-tools/json-format",
        element: <JsonFormat />,
      },
      {
        path: "text-tools/text-deduplication",
        element: <TextDeduplication />,
      },
      {
        path: "text-tools/text-trim",
        element: <TextTrim />,
      },
      {
        path: "text-tools/px2rem",
        element: <Px2Rem />,
      },
      {
        path: "other-tools",
        element: <OtherTools />,
      },
      {
        path: "image-tools/image-width-height-modify",
        element: <ImageWidthHeightModify />,
      },
      {
        path: "image-tools/image-to-ico",
        element: <ImageToIco />,
      },
      {
        path: "image-tools/image-splicing",
        element: <ImageSplicing />,
      },
      {
        path: "*",
        element: <NotFound />,
      },
    ],
  },
];

const router = createBrowserRouter(routes);

export default router;
